#pragma once

#include "Temperament.h"
#include "AudioEngine/PlaySession.h"
#include <map>
#include "AudioEngine/EnvelopeParameters.h"

class PianoEngine
{
	sp<Temperament> temperament;
	std::map<int, sp<AudioEngine::PlaySession> > play_sessions;
	CL_SlotContainer slot_container;
	EnvelopeParameters envelope_parameters;

public:
	PianoEngine(sp<Temperament> temperament);

	sp<Temperament> get_temperament() const { return temperament; }
	void set_temperament(sp<Temperament> val) { temperament = val; }
	void on_session_finished(int note_id);

	void begin_playing_note(int note_id);
	void begin_note_release(int note_id);

	EnvelopeParameters* get_envelope_parameters() { return &envelope_parameters; }
};